<!--解绑银行卡-->
#define changebankcard()
	<div id="changebankcardmengban" hidden  style="background-color:rgba(0,0,0,0.4);position:fixed;top:0;width:100%;height:100%;z-index:550">
		<div align="center" style="width:100%;">
			<div style="width:1100px;font-size:14px;">
				<div style="width:500px;height:500px;position:relative;top:200px;background:#FFF">
					<div id="tan_title" style="height:40px;line-height:40px;background:#fafafa">
						<span style="font-size:20px;">解绑银行卡</span>
						<img class="closethis" style="height:30px;float:right;margin-top:-10px;margin-right:-10px;" src="#(path)/assets/home/account/account_img18.png">
					</div>
					<!--登录密码-->
					<div id="changemobilefirst" style="padding:20px;">
						<!--验证码修改-->
						<div id="telephone" align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:40px;"><a>卡&nbsp;&nbsp;&nbsp;号</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="changecardnum" disabled type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:280px">
							</div>
						</div>
						<div id="telephone" align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:40px;"><a>开户行</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="changecardbank" disabled type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:280px">
							</div>
						</div>
						<div id="telephone" align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:40px;"><a>开户行所在地</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="changecardsheng" disabled type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:230px">
							</div>
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:40px;"><a>手机号</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="changecardmobile" disabled type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:280px">
							</div>
						</div>
						
						<div id="codes" style="clear:both;background:#fff;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>验证码</a></div>
							<div align="center" style="float:left;line-height:40px;font-size:16px;margin-left:20px;">
								<input placeholder="输入验证码" id="changecardcode" style="border:1px solid #dcdcdc;padding-left:15px;height:40px;width:120;font-size:16px;" type="tel"  />
							</div>
							<input id="getchangecardcode" value="获取验证码" style="color:#FFF;float:left;width:70px;margin-left:10px;background:#fa4357;height:40px;text-align:center;border-radius:5px;" >
						</div> 
					</div>
					<!--下一步--> 
					<div  style="clear:both;height:40px;clear:both;width:400px;margin-top:30px;">
						<span id="changecardtrue" class="qixian yuefen yuefens">确 定</span>
					</div>
				</div>
			</div>
		</div>
	</div>
<script>
	var url ="#(path)/card/mainCard?token=#(session.token??)";
	$.getJSON(url, function(datainfo) {
		console.log(datainfo);
		$("#changecardnum").val(datainfo.data.card.bank_account.substring(0,4)+"****"+datainfo.data.card.bank_account.substring(15,19));
		$("#changecardbank").val(datainfo.data.card.bank_name);
		$("#changecardsheng").val(datainfo.data.card.province+" "+datainfo.data.card.city);
		$("#changecardmobile").val(datainfo.data.card.mobile.substring(0,3)+"****"+datainfo.data.card.mobile.substring(5,9));
		$("#getchangecardcode").click(function(){
			$.getJSON("#(path)/card/unbindBankCard?token=#(session.token??)&id="+datainfo.data.card.id+"&code="+datainfo.data.card.code+"&ip=127.0.0.1", function(datainfo1) {
				if(datainfo1.code=='success'){
					layer.msg("验证码发送成功！",{icon:1,time:1000},function(){
						$("#changecardtrue").click(function(){ 
							var sms = $("#code").val();
							if(sms==""){
								layer.msg("请填写验证码！",{icon:2,time:1000});
							}else{
								$.getJSON("#(path)/card/unbindBankCardAdvance?token=#(session.token??)&id="+datainfo1.data.id+"&ticket="+datainfo1.data.ticket+"&sms="+sms, function(datainfo2) {
									if(datainfo2.code=='success'){
										layer.msg(datainfo2.msg,{icon:1,time:1000},function(){
											window.location.href="#(path)/account-account";
										}); 
									}else{
										layer.msg(datainfo2.msg,{icon:2,time:1000}); 
									}
								});
							}
						});
					});
				}else{
					layer.msg(datainfo1.msg,{icon:2,time:1000}); 
				}
			});
		});
		
	});
	
	$(".closethis").click(function(){
		$("#changebankcardmengban").hide();
	});
	var wait=60;  
	function waittime(o) {  
		if (wait == 0) {  
			o.removeAttribute("disabled");            
			o.value="获取验证码";  
			wait = 60;  
		} else {  
			o.setAttribute("disabled", true);  
			o.value="(" + wait + ")";  
			wait--;  
			setTimeout(function() {  
				waittime(o)  
			},  
			1000)  
		}  
	}  
</script>
#end
<!--登录密码-->
#define changepassword()
	<div id="changepasswordmengban" hidden  style="background-color:rgba(0,0,0,0.4);position:fixed;top:0;width:100%;height:100%;z-index:550">
		<div align="center" style="width:100%;">
			<div style="width:1100px;font-size:14px;">
				<div style="width:500px;height:350px;position:relative;top:200px;background:#FFF">
					<div id="tan_title" style="height:40px;line-height:40px;background:#fafafa">
						<span style="font-size:20px;">登录密码设置</span>
						<img class="closethis" style="height:30px;float:right;margin-top:-10px;margin-right:-10px;" src="#(path)/assets/home/account/account_img18.png">
					</div>
					<!--登录密码-->
					<div id="changemobilefirst" style="padding:20px;">
						<!--验证码修改-->
						<div id="telephone" align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>手机号</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="passwordmobile" disabled placeholder="手机号" type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:200px">
							</div>
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>新密码</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="newpassword" placeholder="新密码" type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:200px">
							</div>
						</div>
						<div id="codes" style="clear:both;background:#fff;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>验证码</a></div>
							<div align="center" style="float:left;line-height:40px;font-size:16px;margin-left:20px;">
								<input placeholder="输入验证码" id="newpasswordcode" style="border:1px solid #dcdcdc;padding-left:15px;height:40px;width:120;font-size:16px;" type="tel"  />
							</div>
							<input id="getpasswordcode" value="获取验证码" style="color:#FFF;float:left;width:70px;margin-left:10px;background:#fa4357;height:40px;text-align:center;border-radius:5px;" >
						</div> 
					</div>
					<!--下一步--> 
					<div  style="clear:both;height:40px;clear:both;width:400px;margin-top:30px;">
						<span id="passwordtrue" class="qixian yuefen yuefens">确 定</span>
					</div>
				</div>
			</div>
		</div>
	</div>
<script>
	var type = "mobile";
	var url ="#(path)/user/info?token=#(session.token??)";
	$.getJSON(url, function(datainfo) {
		$("#passwordmobile").val(datainfo.data.info.mobile);
		//获取验证码
		$("#getpasswordcode").click(function(){
			$.getJSON("#(path)/sys/sendCode?token=#(session.token??)&type=ressetPassword&mobile="+datainfo.data.info.mobile, function(datainfo) {
				if(datainfo.code=='success'){
					layer.msg(datainfo.msg,{icon:1,time:1000});
					waittime(getcode);
				}else{
					layer.msg(datainfo.msg,{icon:2,time:1000}); 
				}
			});
		});
	});
	$("#passwordtrue").click(function(){
		var passwordmobile = $("#passwordmobile").val();
		var newpassword = $("#newpassword").val(); 
		var newpasswordcode = $("#newpasswordcode").val(); 
		console.log(111);
		$.getJSON("#(path)/user/ressetPassword?token=#(session.token??)&mobile="+passwordmobile+"&pass="+newpassword+"&sms="+newpasswordcode, function(datainfo) {
			if(datainfo.code=='success'){
				layer.msg(datainfo.msg,{icon:1,time:2000},function(){ 
					window.location.href="#(path)/user-login"; 
				});
			}else{ 
				layer.msg(datainfo.msg,{icon:2,time:1000});  
			}
		});
	});
	
	$(".closethis").click(function(){
		$("#changepasswordmengban").hide();
	});
	var wait=60;  
	function waittime(o) {  
		if (wait == 0) {  
			o.removeAttribute("disabled");            
			o.value="获取验证码";  
			wait = 60;  
		} else {  
			o.setAttribute("disabled", true);  
			o.value="(" + wait + ")";  
			wait--;  
			setTimeout(function() {  
				waittime(o)  
			},  
			1000)  
		}  
	}  
</script>
#end
<!--充值-->
#define recharge()
	<div id="rechargemengban" hidden  style="background-color:rgba(0,0,0,0.4);position:fixed;top:0;width:100%;height:100%;z-index:550">
		<div align="center" style="width:100%;">
			<div style="width:1100px;font-size:14px;">
				<div style="width:600px;height:550px;position:relative;top:200px;background:#FFF">
					<!--充值-->
					<div style="height:40px;line-height:40px;background:#fafafa">
						<span style="font-size:20px;">充值</span>
						<img class="closethis" style="height:30px;float:right;margin-top:-10px;margin-right:-10px;" src="#(path)/assets/home/account/account_img18.png">
					</div>
					<div style="padding:20px;">
						<div align="center" style="width:400px;">
							<img style="height:30px;" src="#(path)/assets/home/account/account_img17.png">
							充值资金将进入您的华夏银行个人存管账户
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>银行卡号</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input disabled id="userbankcard" type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:300px">
							</div> 
						</div>
						<span style="color:#f05f64">提示：银行卡为您绑定的投资银行卡</span>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>充值金额</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;"> 
								<input id="rechargeNum"  placeholder="单笔不少于100元" type="text" style="font-size:16px;height:40px;border:1px solid #dcdcdc;padding-left:20px;width:300px">
							</div>
						</div>
						
						<div  style="width:400px;margin-top:10px;">
							<span id="recarge_truebt" class="qixian yuefen yuefens">立即充值</span>
						</div> 
						<div  style="clear:both;width:100%;margin-top:10px;font-size:14px;">
							<div align="left" style="width:90%;line-height:20px;font-size:14px;">
								<img style="width:100%;" src="/assets/home/account/recarge.jpg">
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<script>
	$.getJSON("#(path)/user/info?token=#(session.token??)", function(recargeuserinfo) {
		console.log(recargeuserinfo); 
		var recargeuserinfo = recargeuserinfo.data.info;
		$(".rechargebt").click(function(){
			if(recargeuserinfo.is_real_name_verify==0){
				layer.msg("您还未实名，不能充值！",{icon:2,time:2000},function(){
					$("#realnamemengban").show();
				}); 
			}else if(recargeuserinfo.is_bind_bank_card==0){
				layer.msg("您还未绑卡，不能充值！",{icon:2,time:2000},function(){
					$("#openaccountmengban").show();
				}); 
			}else{	
				$("#rechargemengban").show();
				$("#userbankcard").val(recargeuserinfo.bank_card.substr(0,4)+"********"+recargeuserinfo.bank_card.substr(15,19));
				$("#recarge_truebt").click(function(){
					var rechargeNum = $("#rechargeNum").val();
					if(rechargeNum < 100){
						layer.msg("充值金额不能少于100元",{icon:2,time:2000},function(){
							$("#rechargeNum").val(100);
						}); 
					}else{
						$.getJSON("#(path)/deposit?token=#(session.token??)&ip=127.0.0.1&amount="+rechargeNum, function(datainfo) {
							console.log(datainfo);
							if(datainfo.code=='success'){
								$("#rechargemengban").hide();
								window.open(datainfo.data.url);
							}else{
								layer.msg(datainfo.msg,{icon:2,time:2000}); 
							}
						}); 
					}
				});
			}
		});
		 
		$("#withdrawbt").click(function(){
			if(recargeuserinfo.is_real_name_verify==0){
				layer.msg("您还未实名，不能提现！",{icon:2,time:2000},function(){
					$("#realnamemengban").show(); 
				});  
			}else if(recargeuserinfo.is_bind_bank_card==0){
				layer.msg("您还未绑卡，不能提现！",{icon:2,time:2000},function(){
					$("#openaccountmengban").show();
				}); 
			}else{	
				
			}
		});
	});
	$(".closethis").click(function(){
		$("#rechargemengban").hide();
	});
</script> 
#end
<!--提现-->
#define withdraw()
	<div id="withdrawbtmengban" hidden  style="background-color:rgba(0,0,0,0.4);position:fixed;top:0;width:100%;height:100%;z-index:550">
		<div align="center" style="width:100%;">
			<div style="width:1100px;font-size:14px;">
				<div style="width:600px;height:550px;position:relative;top:200px;background:#FFF">
					<!--提现-->
					<div style="height:40px;line-height:40px;background:#fafafa">
						<span style="font-size:20px;">提现</span>
						<img class="closethis" style="height:30px;float:right;margin-top:-10px;margin-right:-10px;" src="#(path)/assets/home/account/account_img18.png">
					</div>
					<div style="padding:20px;">
		
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>账户余额</a></div>
							<div id="useravailableAmount" style="float:left;line-height:40px;margin-left:20px;">
							</div>
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>提现金额</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="withdrawNum"  placeholder="提现金额" type="text" style="font-size:16px;height:40px;border:1px solid #dcdcdc;padding-left:20px;width:200px">
								<input id="onekeywithdraw" value="一键提现" type="button" style="cursor:pointer;background:#fa4357;border-radius:10px;color:#FFF;text-align:center;font-size:16px;height:40px;width:90px">
							</div>
						</div>
						
						<div  style="width:400px;margin-top:10px;">
							<span id="withdraw_truebt" class="qixian yuefen yuefens">立即提现</span>
						</div> 
						<div  style="clear:both;width:100%;margin-top:10px;font-size:14px;">
							<div align="left" style="width:90%;line-height:20px;font-size:14px;">
								<img style="width:100%;" src="/assets/home/account/withdraw.jpg">
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<script>
	$.getJSON("#(path)/user/info?token=#(session.token??)", function(withdrawuserinfo) {
		console.log(withdrawuserinfo);
		var withdrawuserinfo = withdrawuserinfo.data.info;
		$("#withdrawbt").click(function(){
			if(withdrawuserinfo.is_real_name_verify==0){
				layer.msg("您还未实名，不能提现！",{icon:2,time:2000},function(){
					$("#realnamemengban").show();
				}); 
			}else if(withdrawuserinfo.is_bind_bank_card==0){
				layer.msg("您还未绑卡，不能提现！",{icon:2,time:2000},function(){
					$("#openaccountmengban").show();
				}); 
			}else{	
				$("#withdrawbtmengban").show();
				$("#useravailableAmount").html(withdrawuserinfo.availableAmount+"元");
				$("#onekeywithdraw").click(function(){
					$("#withdrawNum").val(withdrawuserinfo.availableAmount);
				});
				$("#withdraw_truebt").click(function(){
					var withdrawNum = $("#withdrawNum").val();
					if(withdrawNum > Number(withdrawuserinfo.availableAmount)){ 
						layer.msg("提现金额不能超过账户余额！",{icon:2,time:2000});
					}else{
						$.getJSON("#(path)/withdraw?token=#(session.token??)&ip=127.0.0.1&amount="+withdrawNum, function(datainfo) {
							if(datainfo.code=='success'){
								$("#withdrawbtmengban").hide();
								$("#withdrawNum").val("");
								window.open(datainfo.data.url);
							}else{
								layer.msg(datainfo.msg,{icon:2,time:2000}); 
							}
						}); 
					}
				});
			}
		}); 
	});
	$(".closethis").click(function(){
		$("#withdrawbtmengban").hide();
	});
</script> 
#end
<!--开户-->
#define openaccount()
	<div id="openaccountmengban" hidden  style="background-color:rgba(0,0,0,0.4);position:fixed;top:0;width:100%;height:100%;z-index:550">
		<div align="center" style="width:100%;">
			<div style="width:1100px;font-size:14px;">
				<div style="width:600px;height:700px;position:relative;top:100px;background:#FFF">
					<!--提现-->
					<div style="height:40px;line-height:40px;background:#fafafa">
						<span style="font-size:20px;">开户</span>
						<img class="closethis" style="height:30px;float:right;margin-top:-10px;margin-right:-10px;" src="#(path)/assets/home/account/account_img18.png">
					</div>
					<div style="padding:20px;">
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;width:130px;text-align:right"><a>真实姓名</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="account_realname" disabled placeholder="真实姓名" type="text" style="font-size:16px;height:40px;border:1px solid #dcdcdc;padding-left:20px;width:200px">
							</div>
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;width:100px;width:130px;text-align:right"><a>身份证号</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="account_certnum" disabled  placeholder="身份证号" type="text" style="font-size:16px;height:40px;border:1px solid #dcdcdc;padding-left:20px;width:200px">
							</div>
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;width:130px;text-align:right"><a>银行卡号</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="account_banknum"  placeholder="银行卡号" type="text" style="font-size:16px;height:40px;border:1px solid #dcdcdc;padding-left:20px;width:200px">
							</div>
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;width:130px;text-align:right"><a>开户行</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<select id="account_bank" style="font-size:16px;height:40px;border:1px solid #dcdcdc;padding-left:20px;width:200px"> 
								  <option value ="1">请选择</option>
								</select>  
							</div>
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;width:130px;text-align:right"><a>开户行所在地</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<div style="float:right;line-height:40px;color:#939393;width:100%">
									<select id="account_sheng" style="margin-right:10px;float:left;font-size:16px;height:40px;border:1px solid #dcdcdc;padding-left:10px;width:95px"> 
									  <option value ="1">请选择省</option>
									</select> 
									<select id="account_shi" style="float:left;font-size:16px;height:40px;border:1px solid #dcdcdc;padding-left:10px;width:95px"> 
									  <option value ="1">请选择市</option>
									</select>  
								</div></div>
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;width:130px;text-align:right"><a>银行预留手机号</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="account_mobile" disabled placeholder="银行预留手机号" type="text" style="font-size:16px;height:40px;border:1px solid #dcdcdc;padding-left:20px;width:200px">
							</div>
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;width:130px;text-align:right"><a>验证码</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<div align="center" style="float:left;line-height:40px;font-size:16px;">
									<input placeholder="输入验证码" id="account_code" style="border:1px solid #dcdcdc;padding-left:15px;height:40px;width:110;font-size:16px;" type="tel"  />
								</div>
									<input id="account_getcode" value="获取验证码" style="color:#FFF;float:left;width:80px;margin-left:10px;background:#fa4357;height:40px;text-align:center;border-radius:5px;" >
								</div>
							</div> 
						</div>
						<div  style="width:400px;margin-top:10px;">
							<span id="account__truebt" class="qixian yuefen yuefens">确 认</span>
						</div>  
						<div align="center" style="width:400px;margin-top:20px;">
							<img style="height:30px;" src="#(path)/assets/home/account/account_img17.png">
							因个人信息涉及到发生购买行为的合同有效性，故<span>用户姓名及身份认证信息</span>不可更改
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<script>
	var accountName;
	var accountmobile;
	var ticket;
	var ip2;
	$.getJSON("#(path)/user/info?token=#(session.token??)",function(datainfo3) {
		console.log(datainfo3); 
		accountName = datainfo3.data.info.real_name;
		accountmobile = datainfo3.data.info.accountmobile;
		$("#account_realname").val(datainfo3.data.info.real_name);
		$("#account_certnum").val(datainfo3.data.info.cert_num);
		$("#account_mobile").val(datainfo3.data.info.mobile);
	});
	$.getJSON("#(path)/card/bankCode",function(datainfo) {
		console.log(datainfo); 
		$.each(datainfo.data, function(i, item){ 
			$("#account_bank").append("<option value ='"+item.code+"'>"+item.name+"</option>");
		});
	});
	$.getJSON("#(path)/sys/area",function(datainfo2) {
		console.log(datainfo2); 
		sheng = datainfo2.province;
		shi = datainfo2.city;
		$.each(sheng, function(i, item){ 
			$("#account_sheng").append("<option value ='"+item.ProID+"'>"+item.name+"</option>");
		});
		$("#account_sheng").change(function(){
			$("#account_shi").empty();
			$.each(shi, function(i, item){ 
				if(item.ProID==$("#account_sheng").val())
					$("#account_shi").append("<option value ='"+item.CityID+"'>"+item.name+"</option>");
			});
		});
	}); 

	$("#account_getcode").click(function(){
		var bankCode = $("#account_bank").val();
		var bankName = $("#account_bank").find("option:selected").text();
		var bankAccount = $("#account_banknum").val();
		var province = $("#account_sheng").val();
		var city = $("#account_shi").val();
		var url1 = "#(path)/card/bindBankCard?token=#(session.token??)&bankName=" + bankName + "&bankCode=" + bankCode +"&bankAccount=" + bankAccount + "&accountName=" +accountName +"&mobile="+accountmobile+"&province="+province+"&city=" + city + "&ip=127.0.0.1";
		if(bankCode==1||province==1||city==1||bankAccount==""){
			layer.msg("信息未填写完整",{icon:2,time:2000}); 
		}else{
			$.getJSON(url1,function(datainfo4) {
				//console.log(datainfo4);
				if(datainfo4.code=='success'){
					ticket = datainfo4.data.ticket;
					ip2 = datainfo4.data.id;
					console.log(ticket); 
					console.log(ip2);  
				}else{
					layer.msg(datainfo4.msg,{icon:2,time:1000}); 
				}
			}); 
		}
	});
	$("#account__truebt").click(function(){
		var sms = $("#account_code").val();
		var url2 = "#(path)/card/bindBankCardAdvance?token=#(session.token??)&ticket=" + ticket + "&id=" +ip2+"&sms="+sms + "&ip=127.0.0.1";
		$.getJSON(url2,function(datainfo5) {
			if(datainfo5.code=='success'){
				$.getJSON("#(path)/user/setPayPassword?token=#(session.token??)",function(datainfo5){
					console.log(datainfo5); 
					url6 = datainfo5.data.url;
					window.location.href=url6;
				});
				 
			}else{
				layer.msg(datainfo5.msg,{icon:2,time:1000}); 
			}
		});
	}); 
	$(".closethis").click(function(){
		$("#openaccountmengban").hide();
	});
</script> 
#end
#define userrealname()
<!--用户实名-->
	<div id="realnamemengban" hidden  style="background-color:rgba(0,0,0,0.4);position:fixed;top:0;width:100%;height:100%;z-index:550">
		<div align="center" style="width:100%;">
			<div style="width:1100px;font-size:14px;">
				<div style="width:500px;height:350px;position:relative;top:200px;background:#FFF">
					<div id="tan_title" style="height:40px;line-height:40px;background:#fafafa">
						<span style="font-size:20px;">实名认证</span>
						<img class="closethis" style="height:30px;float:right;margin-top:-10px;margin-right:-10px;" src="#(path)/assets/home/account/account_img18.png">
					</div>
					<!--实名-->
					<div style="padding:20px;">
						<div align="left" style="width:400px;">
							<img style="height:30px;" src="#(path)/assets/home/account/account_img17.png">
							为了保护您的账户安全及出借权益，投资前需开通华夏银行存管账户并进行实名认证
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>真实姓名</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="userealName"  placeholder="请输入真实姓名" type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:200px">
							</div>
						</div>
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>身份证号</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="usercertNum"  placeholder="请输入身份证号" type="text" style="font-size:16px;height:40px;border:1px solid #dcdcdc;padding-left:20px;width:200px">
							</div>
						</div>
						<div  style="clear:both;height:50px;width:100%;margin-top:10px;font-size:14px;">
							<div align="left" style="width:90%;line-height:20px;font-size:14px;">
							<span>
								开户即代表您已阅读并同意
								<a style="color:#ff4d63;text-decoration:none" href="/app/page/help-openAccount">《旺进财存管账户开户说明》</a>
								以及旺进财的
								<a style="color:#ff4d63;text-decoration:none" href="/app/page/help-riskWarn">《风险提示函》</a>
							</span>
							</div>
						</div>
						<div  style="width:400px;margin-top:10px;">
							<span id="realname_ok" class="qixian yuefen yuefens">立即开通</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script>
	$("#realname_ok").click(function(){
		var userealName = $("#userealName").val();
		var usercertNum = $("#usercertNum").val();
		$.getJSON("/user/setRealName?token=#(session.token??)&realName="+userealName+"&certNum="+usercertNum+"&ip="+ip_l,function(datainfo) {
			console.log(datainfo);
			if(datainfo.code=='success'){
				layer.msg(datainfo.msg,{icon:1,time:1000}); 
				window.location.href="#(path)/app/page/user-bidbank";
			}else{
				layer.msg(datainfo.msg,{icon:2,time:1000}); 
			}
		});
	});
	$(".closethis").click(function(){
		$("#realnamemengban").hide();
	});
	</script>
#end
<!--用户手机号码更改-->
#define userchangemobile()
	<div id="changemobilemengban" hidden  style="background-color:rgba(0,0,0,0.4);position:fixed;top:0;width:100%;height:100%;z-index:550">
		<div align="center" style="width:100%;">
			<div style="width:1100px;font-size:14px;">
				<div style="width:500px;height:350px;position:relative;top:200px;background:#FFF">
					<div id="tan_title" style="height:40px;line-height:40px;background:#fafafa">
						<span style="font-size:20px;">用户名更改</span>
						<img class="closethis" style="height:30px;float:right;margin-top:-10px;margin-right:-10px;" src="#(path)/assets/home/account/account_img18.png">
					</div>
					<!--修改用户名-->
					<div id="changemobilefirst" style="padding:20px;">
						<!--验证码修改-->
						<div id="telephone" align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>手机号</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="usermobile" disabled placeholder="手机号" type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:200px">
							</div>
						</div>
						<div id="codes" style="clear:both;background:#fff;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>验证码</a></div>
							<div align="center" style="float:left;line-height:40px;font-size:16px;margin-left:20px;">
								<input placeholder="输入验证码" id="changemobilecode" style="border:1px solid #dcdcdc;padding-left:15px;height:40px;width:120;font-size:16px;" type="tel"  />
							</div>
							<input id="getcode" value="获取验证码" style="color:#FFF;float:left;width:70px;margin-left:10px;background:#fa4357;height:40px;text-align:center;border-radius:5px;" >
						</div> 
						<!--选择问题-->
						<div id="chosequestion" hidden align="left" style="clear:both;background:#fff;height:50px;line-height:40px;width:100%;margin-top:20px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:40px;"><a>安全问题</a></div>
							<select id="changemobilequestion" style="float:left;color:#666;margin-left:20px;padding-left:10px;height:40px;width:280px;font-size:14px;border:1px solid #dcdcdc;" />
								  <option value ="">请选择安全问题</option> 
								  <option value ="您父亲的生日是几月几日？">问题1：您父亲的生日是几月几日？</option>
								  <option value ="您母亲的生日是几月几日？">问题2：您母亲的生日是几月几日？</option>
								  <option value ="您就读的高中全称叫什么？">问题3：您就读的高中全称叫什么？</option>
								  <option value ="您就职的第一家公司叫什么名称？">问题4：您就职的第一家公司叫什么名称？</option>
								  <option value ="您高中的班主任姓氏是什么？">问题5：您高中的班主任姓氏是什么？</option> 
							</select>
						</div> 
						<!--问题答案-->
						<div align="left" hidden id="ansower" style="float:left;background:#fff;height:50px;line-height:40px;width:100%px;;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:40px;"><a>问题答案</a></div>
							<input placeholder="请填写问题答案" id="changemobileanswer" style="font-size:14px;color:#666;margin-left:20px;padding-left:20px;height:40px;width:280px;font-size:16px;border:1px solid #dcdcdc;"   />
						</div> 
						<!--下一步-->
						<div  style="clear:both;height:40px;clear:both;width:400px;margin-top:30px;">
							<span id="changemobilenext" class="qixian yuefen yuefens">下一步</span>
						</div>
						<div id="usequestion" align="right" style="font-size:14px;clear:both;height:40px;width:100%;line-height:40px;">
							安全问题修改手机号
							<img style="width:14px;margin-right:20px;vertical-align:middle;" src="/assets/images/mobile/personal_jiantou2.png">
						</div>
						<div id="usecode" hidden align="right" style="font-size:14px;clear:both;height:40px;width:100%;line-height:40px;">
							验证码修改手机号 
							<img style="width:14px;margin-right:20px;vertical-align:middle;" src="/assets/images/mobile/personal_jiantou2.png">
						</div>
					</div>
					<div id="changemobilesecond" hidden style="padding:20px;">
						<div align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>新手机号码</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="newmobile" placeholder="新手机号" type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:200px">
							</div>
						</div>
						<div style="clear:both;background:#fff;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>获取验证码</a></div>
							<div align="center" style="float:left;line-height:40px;font-size:16px;margin-left:20px;">
								<input placeholder="输入验证码" id="changemobilecodesecond" style="border:1px solid #dcdcdc;padding-left:15px;height:40px;width:120;font-size:16px;" type="tel"  />
							</div>
							<input id="getcodesecond" value="获取验证码" style="color:#FFF;float:left;width:70px;margin-left:10px;background:#fa4357;height:40px;text-align:center;border-radius:5px;" >
						</div> 
						
						<!--下一步--> 
						<div  style="clear:both;height:40px;clear:both;width:400px;margin-top:30px;">
							<span id="mobilesecond" class="qixian yuefen yuefens">确定</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<script>
	var type = "mobile";
	var url ="#(path)/user/info?token=#(session.token??)";
	$.getJSON(url, function(datainfo) {
		$("#usermobile").val(datainfo.data.info.mobile);
		//获取验证码
		$("#getcode").click(function(){
			$.getJSON("#(path)/sys/sendCode?token=#(session.token??)&type=modifyMobileOld&mobile="+datainfo.data.info.mobile, function(datainfo) {
				if(datainfo.code=='success'){
					layer.msg(datainfo.msg,{icon:1,time:1000});
					waittime(getcode);
				}else{
					layer.msg(datainfo.msg,{icon:2,time:1000}); 
				}
			});
		});
		//使用安全问题
		$("#usequestion").click(function(){
			type = "question";
			if(datainfo.data.info.is_set_auth_question==1){
				$("#codes").hide();
				$("#telephone").hide();
				$("#usequestion").hide(); 
				$("#usecode").show();
				$("#chosequestion").show();
				$("#ansower").show();
				$("#code").val("");
			}else{
				layer.msg("您还为设置安全问题！",{icon:2,time:1000},function(){
					//window.location.href="/app/page/user-question";
					$("#changemobilemengban").hide();
					$("#changeanswermengban").show();
				});
			}
		});
		//使用手机验证码
		$("#usecode").click(function(){
			$("#codes").show();
			$("#telephone").show();
			$("#usequestion").show();
			$("#usecode").hide();
			$("#chosequestion").hide();
			$("#ansower").hide(); 
			$("#changemobilequestion").val("");
			$("#changemobileanswer").val("");
			type = "mobile";
		});
		
	});
	var changemobilecode;
	$("#changemobilenext").click(function(){
		 changemobilecode = $("#changemobilecode").val();
		var usermobile = $("#usermobile").val();
		var changemobilequestion = $("#changemobilequestion").val(); 
		var changemobileanswer = $("#changemobileanswer").val();  
		$.getJSON("#(path)/user/modifyMobile?token=#(session.token??)&type=check&sms="+changemobilecode+"&mobile="+usermobile+"&question="+changemobilequestion+"&answer="+changemobileanswer, function(datainfo) {
			if(datainfo.code=='success'){
				layer.msg(datainfo.msg,{icon:1,time:2000},function(){
					$("#changemobilefirst").hide();
					$("#changemobilesecond").show();
				});
			}else{ 
				layer.msg(datainfo.msg,{icon:2,time:1000});  
			}
		});
	});
	//新号码确认
	$("#getcodesecond").click(function(){
		var newmobile = $("#newmobile").val();
		if(newmobile==""){
			layer.msg("请输入新号码！",{icon:2,time:1000}); 
		}else{
			$.getJSON("#(path)/sys/sendCode?token=#(session.token??)&type=modifyMobileNew&mobile="+newmobile, function(datainfo) {
				if(datainfo.code=='success'){ 
					layer.msg(datainfo.msg,{icon:1,time:1000});
					waittime(getcode);
				}else{
					layer.msg(datainfo.msg,{icon:2,time:1000}); 
				}
			});
		} 
	});
	$("#mobilesecond").click(function(){
		var changemobilecodesecond = $("#changemobilecodesecond").val();
		var newmobile = $("#newmobile").val();
		var oldmobile = $("#usermobile").val(); 
		var changemobilequestion = $("#changemobilequestion").val();
		var changemobileanswer = $("#changemobileanswer").val();  
		
		$.getJSON("#(path)/user/modifyMobile?token=#(session.token??)&type="+type+"&sms="+changemobilecode+"&mobile="+oldmobile+"&question="+changemobilequestion+"&answer="+changemobileanswer+"&mobile2="+newmobile+"&sms2="+changemobilecodesecond, function(datainfo) {
			if(datainfo.code=='success'){
				layer.msg(datainfo.msg,{icon:1,time:1000},function(){
					window.location.href="#(path)/user-login"; 
				});
				
			}else{
				layer.msg(datainfo.msg,{icon:2,time:1000}); 
			}
		});
	});
	$(".closethis").click(function(){
		$("#changemobilemengban").hide();
	});
	var wait=60;  
	function waittime(o) {  
		if (wait == 0) {  
			o.removeAttribute("disabled");            
			o.value="获取验证码";  
			wait = 60;  
		} else {  
			o.setAttribute("disabled", true);  
			o.value="(" + wait + ")";  
			wait--;  
			setTimeout(function() {  
				waittime(o)  
			},  
			1000)  
		}  
	}  
</script>
#end
#define userchangemail()
	<div id="changemailmengban" hidden  style="background-color:rgba(0,0,0,0.4);position:fixed;top:0;width:100%;height:100%;z-index:550">
		<div align="center" style="width:100%;">
			<div style="width:1100px;font-size:14px;">
				<div style="width:500px;height:350px;position:relative;top:200px;background:#FFF">
					<div id="tan_title" style="height:40px;line-height:40px;background:#fafafa">
						<span style="font-size:20px;">用户邮箱设置</span>
						<img class="closethis" style="height:30px;float:right;margin-top:-10px;margin-right:-10px;" src="#(path)/assets/home/account/account_img18.png">
					</div>
					<!--邮箱设置-->
					<div style="padding:20px;">
						<!--验证码修改-->
						<div id="telephone" align="center" style="clear:both;height:50px;width:100%;margin-top:20px;">
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>邮 箱 地 址</a></div>
							<div style="float:left;line-height:40px;margin-left:20px;">
								<input id="useremail"  placeholder="邮箱地址" type="text" style="font-size:16px;border:1px solid #dcdcdc;padding-left:20px;height:40px;width:200px">
							</div>
						</div>
						<div id="codes" style="clear:both;background:#fff;height:50px;width:100%;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:80px;"><a>邮箱验证码</a></div>
							<div align="center" style="float:left;line-height:40px;font-size:16px;margin-left:20px;">
								<input placeholder="输入验证码" id="emailcode" style="border:1px solid #dcdcdc;padding-left:15px;height:40px;width:120;font-size:16px;" type="tel"  />
							</div>
							<input id="getemailcode" value="获取验证码" style="color:#FFF;float:left;width:70px;margin-left:10px;background:#fa4357;height:40px;text-align:center;border-radius:5px;" >
						</div>  
						<div  style="width:400px;margin-top:10px;">
							<span id="emailnext" class="qixian yuefen yuefens">确认提交</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<script>
	$("#getemailcode").click(function(){
		var email = $("#useremail").val(); 
		if(email==""){
			layer.msg("邮箱不能为空！",{icon:2,time:1000}); 
		}else{
			$.getJSON("#(path)/user/setEmail?token=#(session.token??)&email="+email, function(datainfo) {
				if(datainfo.code=='success'){
					layer.msg(datainfo.msg,{icon:1,time:1000});
					waittime(getcode);
				}else{
					layer.msg(datainfo.msg,{icon:2,time:1000}); 
				}
			});
		}
	});
	$("#emailnext").click(function(){
		var email = $("#useremail").val();
		var code = $("#code").val();
		$.getJSON("#(path)/user/setEmailAdvance?token=#(session.token??)&email="+email+"&code="+code, function(datainfo) {
			console.log(datainfo);
			if(datainfo.code=='success'){
				layer.msg(datainfo.msg,{icon:1,time:1000},function(){
					window.location.href="#(path)/account-account";
				});
			}else{
				layer.msg(datainfo.msg,{icon:2,time:1000}); 
			}
		});
	});
	$(".closethis").click(function(){
		$("#changemailmengban").hide();
	});
	var wait=60;  
	function waittime(o) {  
		if (wait == 0) {  
			o.removeAttribute("disabled");            
			o.value="获取验证码";  
			wait = 60;  
		} else {  
			o.setAttribute("disabled", true);  
			o.value="(" + wait + ")";  
			wait--;  
			setTimeout(function() {  
				waittime(o)  
			},  
			1000)  
		}  
	}  
</script>
#end
#define userchangeanswer()
	<div id="changeanswermengban" hidden  style="background-color:rgba(0,0,0,0.4);position:fixed;top:0;width:100%;height:100%;z-index:550">
		<div align="center" style="width:100%;">
			<div style="width:1100px;font-size:14px;">
				<div style="width:500px;height:350px;position:relative;top:200px;background:#FFF">
					<div id="tan_title" style="height:40px;line-height:40px;background:#fafafa">
						<span style="font-size:20px;">用户安全问题设置</span>
						<img class="closethis" style="height:30px;float:right;margin-top:-10px;margin-right:-10px;" src="#(path)/assets/home/account/account_img18.png">
					</div>
					<!--用户安全问题设置-->
					<div id="oldquestion" style="padding:20px;">
						<div align="left" style="width:400px;">
								安全保护问题可用于找回登录密码，并提升账户安全性。<br>
								安全保护问题是您账户重要的身份验证方式，请务必仔细填写并记牢答案。<br>
								您填写的信息经系统加密，绝不外泄，请放心填写。
						</div>
						<div align="left" style="clear:both;background:#fff;height:50px;line-height:40px;width:100%;margin-top:20px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:40px;"><a>安全问题</a></div>
							<select id="olduserquestion" style="font-size:14px;float:left;color:#666;margin-left:20px;padding-left:10px;height:40px;width:280px;font-size:16px;border:1px solid #dcdcdc;" />
								  <option value ="">请选择安全问题</option> 
								  <option value ="您父亲的生日是几月几日？">问题1：您父亲的生日是几月几日？</option>
								  <option value ="您母亲的生日是几月几日？">问题2：您母亲的生日是几月几日？</option>
								  <option value ="您就读的高中全称叫什么？">问题3：您就读的高中全称叫什么？</option>
								  <option value ="您就职的第一家公司叫什么名称？">问题4：您就职的第一家公司叫什么名称？</option>
								  <option value ="您高中的班主任姓氏是什么？">问题5：您高中的班主任姓氏是什么？</option> 
							</select>
						</div> 
						<!--问题答案-->
						<div align="left" style="float:left;background:#fff;height:50px;line-height:40px;width:100%px;;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:40px;"><a>问题答案</a></div>
							<input placeholder="请填写问题答案" id="olduseranswer" style="font-size:14px;color:#666;margin-left:20px;padding-left:20px;height:40px;width:280px;font-size:16px;border:1px solid #dcdcdc;"   />
						</div>
						<div  style="clear:both;width:400px;margin-top:10px;">
							<span id="oldquestionext" class="qixian yuefen yuefens">下一步</span>
						</div>
					</div>
					<!--新问题-->
					<div id="newquestion" hidden style="padding:20px;">
						<div align="left" style="width:400px;">
								安全保护问题可用于找回登录密码，并提升账户安全性。<br>
								安全保护问题是您账户重要的身份验证方式，请务必仔细填写并记牢答案。<br>
								您填写的信息经系统加密，绝不外泄，请放心填写。
						</div>
						<div  align="left" style="clear:both;background:#fff;height:50px;line-height:40px;width:100%;margin-top:20px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:40px;"><a>安全问题</a></div>
							<select id="newuserquestion" style="font-size:14px;float:left;color:#666;margin-left:20px;padding-left:10px;height:40px;width:280px;border:1px solid #dcdcdc;" />
								  <option value ="">请选择安全问题</option> 
								  <option value ="您父亲的生日是几月几日？">问题1：您父亲的生日是几月几日？</option>
								  <option value ="您母亲的生日是几月几日？">问题2：您母亲的生日是几月几日？</option>
								  <option value ="您就读的高中全称叫什么？">问题3：您就读的高中全称叫什么？</option>
								  <option value ="您就职的第一家公司叫什么名称？">问题4：您就职的第一家公司叫什么名称？</option>
								  <option value ="您高中的班主任姓氏是什么？">问题5：您高中的班主任姓氏是什么？</option> 
							</select>
						</div> 
						<!--问题答案-->
						<div align="left" style="float:left;background:#fff;height:50px;line-height:40px;width:100%px;;margin-top:10px;"> 
							<div style="float:left;line-height:40px;font-size:16px;margin-left:40px;"><a>问题答案</a></div>
							<input placeholder="请填写问题答案" id="newuseranswer" style="font-size:14px;color:#666;margin-left:20px;padding-left:20px;height:40px;width:280px;font-size:16px;border:1px solid #dcdcdc;"   />
						</div>
						<div  style="clear:both;width:400px;margin-top:10px;">
							<span id="newquestionext" class="qixian yuefen yuefens">确认提交</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<script>
	$("#oldquestionext").click(function(){
		var olduserquestion = $("#olduserquestion").val();
		var olduseranswer = $("#olduseranswer").val();
		if(olduserquestion == 1){
			layer.msg("请选择安全问题！",{icon:2,time:1000}); 
		}else if(olduseranswer==""){
			layer.msg("请填写问题答案！",{icon:2,time:1000}); 
		}else{ 
			$.getJSON("#(path)/user/checkAuthQuestion?token=#(session.token??)&question="+olduserquestion+"&answer="+olduseranswer, function(datainfo) {
				if(datainfo.code=='success'){
					layer.confirm('安全问题验证成功！', {
					  btn: ['取消安全问题','重置问题'] //按钮
					}, function(){
					   $.getJSON("#(path)/user/clearAuthQuestion?token=#(session.token??)",function(){
							if(datainfo.code=='success'){
								layer.msg(datainfo.msg,{icon:1,time:2000},function(){ 
									$("#changeanswermengban").hide();
								});
							}
					   }); 
					}, function(){
						$("#oldquestion").hide();
						$("#newquestion").show();
						$("#newquestionext").click(function(){
							var newuserquestion = $("#newuserquestion").val();
							var newuseranswer = $("#newuseranswer").val();
							if(newuserquestion==1){
								layer.msg("请选择安全问题！",{icon:2,time:1000}); 
							}else if(newuseranswer==""){
								layer.msg("请填写问题答案！",{icon:2,time:1000}); 
							}else{
								$.getJSON("#(path)/user/setAuthQuestion?token=#(session.token??)&question="+newuserquestion+"&answer="+newuseranswer, function(datainfo) {
									if(datainfo.code=='success'){
										layer.msg(datainfo.msg,{icon:1,time:2000},function(){ 
											window.location.href="#(path)/account-account";
										}); 
									}else{
										layer.msg(datainfo.msg,{icon:2,time:1000}); 
									}
								});
							}
						});
					});
				}else{ 
					layer.msg(datainfo.msg,{icon:2,time:1000}); 
				}
			});
		}
	});
	$(".closethis").click(function(){
		$("#changeanswermengban").hide();
	});
</script>
#end

<!--pc电脑-->
#define homejs()
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<script type="text/javascript" src="#(assets)/js/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="#(assets)/js/app.js"></script>
<script type="text/javascript" src="#(assets)/js/layer/layer.js"></script> 
<script type="text/javascript" src="#(assets)/js/unslider.min.js"></script>
<script type="text/javascript" src="#(assets)/js/jQuery.ellipsis.js"></script>
<script type="text/javascript" src="#(path)/assets/js/jquery.tmpl.min.js"></script> 
#end
#define homemenu(menu)
<link rel="stylesheet" href="#(assets)/css/pcstyle.css">
<div align="center" style="background:#fafafa;height:35px;width:100%">
	<div style="width:1100px;color:#929196;line-height:35px;font-size:13px;">
		<div style="float:left;">
			<span>客服热线：400-800-7118（工作时间：9:00-17:00）</span>               
		</div>
		<div style="float:right;">
			<span onclick="location.href='#(path)/user-login'" style="cursor:pointer;color:#fb4357;margin-right:5px;">登录</span>
			<span onclick="location.href='#(path)/user-reg'"style="cursor:pointer;color:#fb4357">注册</span>
			<span style="cursor:pointer;color:#505760">|</span>
			<span onclick="location.href='#(path)/aboutus-aboutus?type=7'" style="cursor:pointer;">加入我们</span> 
			<span style="cursor:pointer;color:#505760">|</span>
			<span style="cursor:pointer;">客服团队</span>
			<span style="cursor:pointer;color:#505760">|</span>
			<span id="appclient" style="cursor:pointer;">手机客户端</span> 
		</div>
	</div> 
	<div align="center" hidden id="appclients" style="position:relative;left:500px;top:40px;height:170px;width:150px;background:#fff;z-index:1000">
		<img style="width:120px;margin-top:20px;" src="#(path)/assets/home/index/downpic.png">
		<br>扫码下载APP
	</div>	
</div>
<div align="center" style="background:#fff;height:95px;width:100%">
	<div style="width:1100px;color:#FFF;line-height:30px;font-size:13px;line-height:30px;">
		<div style="float:left;">
			<img style="margin-top:30px;height:40px;" src="/assets/images/test/logo.png">
		</div>
		<div style="float:right;margin-top:30px;">
			<div align="center" style="padding:0 10px 0 10px;float:right;">
				<li onclick="window.location.href='/account-account'" style="color:#242424;float:right;list-style:none;font-size:18px;">
					<img style="" src="/assets/home/user/reg_img1.png">
					<a class="#if(menu=='account') account_menu2 #end" style="margin-right:0;float:none;cursor:pointer;">我的账户 </a>
					<img style="cursor:pointer;" src="/assets/home/user/reg_img2.png">
				</li>  
			</div> 
			<div style="float:right"> 
				<li class="#if(menu=='aboutus') menuactive #else menuactive1 #end" onclick="window.location.href='#(path)/aboutus-aboutus'">
					<a>关于我们</a>
				</li>
				<!--<li class="#if(menu=='message') menuactive #else menuactive1 #end"  onclick="window.location.href='/'" >
					<a>信息披露 </a>
				</li>
				<li class="#if(menu=='shop') menuactive #else menuactive1 #end"  onclick="window.location.href='/'" >
					<a>商城 </a>
				</li>-->
				<li class="#if(menu=='trade') menuactive #else menuactive1 #end"  onclick="window.location.href='#(path)/trade-tradelist'">
					<a>理财 </a>
				</li>
				<li class="#if(menu=='index') menuactive #else menuactive1 #end"  onclick="window.location.href='#(path)/index2'">
					<a>首页 </a>
				</li>
			</div>
		</div>
	</div>
</div>
<script>
	$("#appclient").mouseover(function(){
		$("#appclients").show();
	});
	$("#appclient").mouseout(function(){
		$("#appclients").hide();
	 });
</script>
#end
#define homefoot1()
<div align="center" style="clear:both;padding-top:30px;margin-top:20px;background:#363b3f;width:100%;height:180px;color:#FFF;font-size:14px;">
	<div style="width:1100px;clear:both;">
		<div style="width:330px;float:left;clear:both;">
			<div align="left" style="color:#FFF;font-size:20px;font-weight:400"> 关于我们</div>
			<div align="left" style="float:left">
				<div onclick="location.href='#(path)/aboutus-aboutus?type=1'" style="cursor:pointer;margin-top:5px;font-size:16px;color:#939393">公司简介</div>
				<div onclick="location.href='#(path)/aboutus-aboutus?type=2'" style="cursor:pointer;margin-top:5px;font-size:16px;color:#939393">管理团队</div>
				<div onclick="location.href='#(path)/aboutus-aboutus?type=3'" style="cursor:pointer;margin-top:5px;font-size:16px;color:#939393">企业文化</div>
			</div>
			<div align="left" style="float:left;margin-left:60px;">
				<div onclick="location.href='#(path)/aboutus-aboutus?type=6'" style="cursor:pointer;margin-top:5px;font-size:16px;color:#939393">合作伙伴</div>
				<div onclick="location.href='#(path)/aboutus-aboutus?type=7'" style="cursor:pointer;margin-top:5px;font-size:16px;color:#939393">加入我们</div>
				<div onclick="location.href='#(path)/aboutus-aboutus?type=8'" style="cursor:pointer;margin-top:5px;font-size:16px;color:#939393">联系我们</div>
			</div>
		</div>
		<div align="center" style="width:320px;float:left;">
			<div style="float:left">
				<img style="width:90px;" src="/assets/images/test/ewm1.jpg"> 
				<div>微信公众号</div>
			</div>
			<div style="float:left;margin-left:20px;">
				<img style="width:90px;" src="/assets/images/test/ewm3.jpg"> 
				<div>微信服务号</div>
			</div>
			<div style="float:left;margin-left:20px;"> 
				<img style="width:90px;" src="/assets/images/test/ewm2.jpg"> 
				<div>微博</div>
			</div>
		</div>
		<div align="left" style="float:right;width:400px;">
			<div>
				<img style="width:25px;vertical-align: middle;" src="/assets/images/test/img3.png"> 
				<a style="font-size:16px;margin-left:5px;">客服热线：</a>
			</div>
			<div>
				<a style="font-size:34px;margin-left:5px;">400-800-7118</a><br>
				<a style="font-size:16px;margin-left:5px;color:#939393">周一到周五 9:00-17:00</a><br>
				<!--<a style="font-size:16px;margin-left:5px;color:#939393">地址：浙江省宁波市人民路645弄日湖国贸中心4F</a>-->
			</div>
		</div>
	</div>
</div>	 
#end
#define homefoot2()
<!--2016 未了财富 All right reserved | 深圳前海大秦投资管理有限公司 | -->
<div align="center" style="font-size:14px;width:600px;color:#939393;margin:0 auto;padding-bottom:10px; ">
	<p>2017 旺进财 财使你前进&nbsp&nbsp|&nbsp&nbsp浙江盈心科技有限公司&nbsp&nbsp|&nbsp&nbsp浙ICP备17041600号</p>
	<a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33020502000193" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img src="#(path)/assets/images/beian.png" style="float:left;"/><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px;color:#939393; ">浙公网安备 33020502000193号</p></a>
</div>
#end
<!--头部文件-->
#define head()
<!DOCTYPE html>
<html>
<head> 
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
	<link rel="stylesheet" href="#(path)/assets/plugins/bootstrap-slider/bootstrap-timepicker.min.css">
	<link rel="stylesheet" href="#(path)/assets/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="#(path)/assets/css/AdminLTE.min.css">
	<link rel="stylesheet" href="#(path)/assets/css/skins/_all-skins.min.css">
	<link rel="stylesheet" href="#(path)/assets/plugins/select2/select2.min.css">
	<link rel="stylesheet" href="#(path)/assets/css/font-awesome-4.7.0/css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="#(path)/assets/plugins/WebUploader/webuploader.css">
	<style type="text/css">*{font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"宋体";}</style>
	<script src="#(path)/assets/plugins/jQuery/jquery-2.2.3.min.js"></script>
	<script src="#(path)/assets/js/dateclick/WdatePicker.js"></script>
	<script src="#(path)/assets/bootstrap/js/bootstrap.min.js"></script>
	<script src="#(path)/assets/plugins/fastclick/fastclick.js"></script>
	<script src="#(path)/assets/js/app.min.js"></script>
	<script src="#(path)/assets/js/demo.js"></script>
	<script src="#(path)/assets/plugins/select2/select2.min.js"></script>
	<script src="#(path)/assets/plugins/select2/i18n/zh-CN.js"></script>
	<script src="#(path)/assets/js/elink.js"></script>
	<script src="#(path)/assets/plugins/layer/layer.js"></script>
	<script type="text/javascript" src="#(path)/assets/plugins/WebUploader/webuploader.js"></script>
	<script>
		if("#(session.token??)"==""){ 
			layer.msg("登陆超时，请重新登陆！", {icon:1,time:1000},function(){
				location.href="#(path)/admin/page/user-login?redirectUrl="+escape(window.location.href);
			});
		}else{
			ajax("#(path)/user/checkToken?token=#(session.token??)",{},function(data){
				if(data.code=='error'){
					layer.msg("登陆超时，请重新登陆！", {icon:1,time:1000},function(){
						location.href="#(path)/admin/page/user-login?redirectUrl="+escape(window.location.href);
					});
				}
			});
		}
	</script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
#end

<!--框架菜单-->
#define header()
<header class="main-header">
	<div style="position:fixed;top:0px;">
		<a href="#(path)/admin/page/user-list" class="logo">
		  <span class="logo-mini"><img src="#(path)/assets/img/logo2.png" width=30px;></span>
		  <span class="logo-lg"><img src="#(path)/assets/img/logo1.png" width=120px;></span>
		</a>
	</div>
    <nav class="navbar navbar-static-top">
      <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>
	<!--客服记录弹窗-->
	#if(shiro.hasAnyRole("admin,agent,agent_leader,agent_manager"))
	<div class="navbar-custom-menu">
        <ul id="addtel" class="nav navbar-nav">
          <li class="dropdown messages-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-comments"> 添加访问 </i>
            </a>
          </li>
        </ul>
	</div>
	<div class="navbar-custom-menu">
        <ul id="zhishiku" class="nav navbar-nav">
          <li class="dropdown messages-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-edit"> 知识库 </i>
            </a>
          </li>
        </ul>
	</div>
	#end
	</nav>

</header>

		<div id="repository" hidden  class="nav-tabs-custom" style="width:49%;float:right;position:absolute;top:75px;right:25px;z-index:1000;border:1px solid #DDD">
			<div id="repository2" style="cursor:pointer;" class="box-header with-border">
			  <h3 class="box-title">知识库</h3>
			  <div class="box-tools pull-right">
				  <i id="hid" class="fa fa-minus"></i></button>
			  </div>
			</div>	 
			<div class="tab-content">
			  <div class="tab-pane active" id="">
				<div class="input-group margin" style="width:60%;float:left">
							<input type="text" id="key" class="form-control" >
							<span class="input-group-btn">
							  <button id="keyseach" type="button" class="btn btn-info btn-flat">搜索</button>
							</span>
						</div>
				<div class="box-body">
					<table id="example1" class="table table-striped">
						<thead>
							<tr>
								<th>ID</th>
								<th>标题</th>
								<th></th>
							</tr>
						</thead>
						<tbody id="zsklist">
						</tbody>
					</table>
				</div>
				<div class="box-footer clearfix">
				  <ul class="pagination pagination-sm no-margin pull-right">
					<li id="zsklist1"><a href="#">首页</a></li>
					<li id="zsklist2"><a href="#">上一页</a></li>
					<li><a href="#">第<span id="zsklist5"></span>页 共<span id="zsklist6"></span>页</a></li>
					<li id="zsklist3"><a href="#">下一页</a></li>
					<li id="zsklist4"><a href="#">尾页</a></li>
				  </ul>
				</div>
			  </div>
			</div>

		</div>
			<script id="zsklistall" type="text/x-jquery-tmpl">
				<tr>
					<td>${id}</td>
					<td>
						${name}
						<div hidden id = "${id}id" style="color:#aaa;background:#f0f0f0;padding:10px;" >${contents}</div>
					</td>
					<td>
						<div class="btn-group">
						  <div class="btn-group">
						  <button pass= "${id}id" type="button" class="btn btn-info pass">查看</button>
						</div>
						</div>
					</td>
				</tr>
			</script>
			<script type="text/javascript" src="#(path)/assets/js/jquery.tmpl.min.js"></script>
			<script>
			var total = 1;
			var pageNum = 1;
			var key = "";
			 $(document).ready(function(){
				total = 1;
				pageNum = 1;
				$("#zsklist").empty();
				zsklist(1);
				$("#zsklist5").html(pageNum);
			});
			repository2.onmousedown = function(e){
				e = window.event || e;
				var deltaX = e.clientX - repository.offsetLeft;
				var deltaY = e.clientY - repository.offsetTop;
				document.onmousemove= function(e){
					e = window.event || e;
					repository.style.left = e.clientX - deltaX + "px";
					repository.style.top = e.clientY - deltaY + "px";
				}
			};
			document.onmouseup = function(){
				this.onmousemove = null;
			};
			$("#zsklist1").click(function(){
				$("#zsklist").empty();
				zsklist(1);
				pageNum = 1;
				$("#zsklist5").html(pageNum);
			});
			$("#zsklist2").click(function(){
				if(pageNum==1){
					alert("当前页是首页!");
				}else{
				$("#zsklist").empty();
				pageNum = pageNum-1;
				zsklist(pageNum);
				$("#zsklist5").html(pageNum);
				}
			});
			$("#zsklist3").click(function(){
				if(pageNum==total){
					alert("当前页是尾页!");
				}else{
				$("#zsklist").empty();
				pageNum = pageNum +1;
				zsklist(pageNum);
				$("#zsklist5").html(pageNum);
				}
			});
			$("#zsklist4").click(function(){
				$("#zsklist").empty();
				zsklist(total);
				pageNum = total;
				$("#zsklist5").html(pageNum);
			});
			$("#keyseach").click(function(){
				total = 1;
				pageNum = 1;
				$("#zsklist").empty();
				key = $("#key").val();
				zsklist(1);
				$("#zsklist5").html(pageNum);
			});
			function zsklist(page){
				$.getJSON("/notice/search?token=#(session.token??)&type=repository&page="+page+"&size=8&key="+key, function(userli) {
					
					total = userli.data.page.totalPage;
					$("#zsklist6").html(total);
					$.each(userli.data.page.list, function(i, item){ 
						var href="#(path)/admin/page/custser-repositoryinfo?id="+item.id;
						var contents = item.contents;
						var zsklist = {contents:contents,href:href,name:item.name,status:status,id:item.id,create_time:item.create_time};
						$("#zsklistall").tmpl(zsklist).appendTo('#zsklist');
					});
					$(".pass").click(function(){
							var idval = $(this).attr("pass");
							
							$("#"+idval).toggle();
							
					});
				});	
			}

			$("#zhishiku").click(function(){
				
				$("#repository").show();
			});
			$("#hid").click(function(){
				
				$("#repository").hide();
			});
		</script>
		<!--添加访问-->
	<div id="addtels" hidden   class="nav-tabs-custom" style="width:49%;float:right;position:absolute;top:65px;right:15px;z-index:1000;border:1px solid #DDD">
		<div id="addtels2" style="cursor:pointer;"  class="box-header with-border">
		  <h3 class="box-title">添加访问</h3>
		  <div class="box-tools pull-right">
			  <i id="hidi" class="fa fa-minus"></i></button>
		  </div>
		</div>	
		<div class="tab-content">
		<div class="tab-pane active" id="ta_b1">
				<div class="box-body">
					<table id="example1" style="" class="table table-bordered table-striped dataTable col-md-8" role="grid" aria-describedby="example1_info">
						<tbody>
						<tr role="row" class="odd">
						  <td align="right" style="width:100px;" class="sorting_1">访问方式：</td>
						  <td class="sorting_1">
							<select id="type2" class="form-control">
								<option value="come">来访</option>
								<option value="back">回访</option>
							  </select>
						  </td> 
						</tr>
						<tr role="row" class="odd">
						  <td align="right" style="width:100px;" class="sorting_1">查找用户：</td>
						  <td>
							<div >
								<select style="width:150px;height:35px;float:left;margin-top:10px;" id="userId2" class="form-control"></select>
							</div> 
						  </td>
						</tr>
						<tr role="row" class="odd">
						  <td align="right" style="width:100px;" class="sorting_1">真实姓名：</td>
						  <td class="sorting_1">
							<input id="realName2" type="text" class="form-control" placeholder="用户名">
							<input id="userdd2" hidden  type="text"  placeholder="用户id">
						  </td>
						</tr>
						<tr role="row" class="odd">
						  <td align="right" style="width:100px;" class="sorting_1">用户名：</td>
						  <td class="sorting_1">
							<input id="mobile2" type="text" class="form-control" placeholder="手机号">
						  </td>
						</tr>
						<tr role="row" class="odd">
						  <td align="right" style="width:100px;" class="sorting_1">访问方式：</td>
						  <td class="sorting_1">
							<select id="tel2" class="form-control">
								<option value="座机">座机</option>
								<option value="400电话">400电话</option>
								<option value="微信公众号">微信公众号</option>
							  </select>
						  </td>
						</tr>
						<tr id="qk" hidden role="row" class="odd">
						  <td align="right" style="width:100px;" class="sorting_1">访问情况：</td>
						  <td class="sorting_1">
							<select id="isValid2" class="form-control">
								<option value="已接">已接</option>
								<option value="未接">未接</option>
								<option value="拒接">拒接</option>
								<option value="无响应">无响应</option>
							  </select>
						  </td> 
						</tr>  
						<tr role="row" class="odd">
						  <td align="right" style="width:100px;" class="sorting_1">客户问题：</td>
						  <td class="sorting_1">
							<textarea id="matter2" class="form-control" rows="3" placeholder="问题内容"></textarea>
						  </td>
						</tr>
						<tr role="row" class="odd">
						  <td align="right" style="width:100px;" class="sorting_1">解决方法：</td>
						  <td class="sorting_1">
							<textarea id="solve2" class="form-control" rows="3" placeholder="解决方法"></textarea>
						  </td>
						</tr> 
						<tr id="issolves" role="row" class="odd">
						  <td align="right" style="width:130px;" class="sorting_1">是否解决：</td>
						  <td  class="sorting_1">
							<select id="isSolve"  class="form-control">
								<option value="1">已解决</option>
								<option value="0">未解决</option>
							</select> 
						  </td> 
						</tr>
						
						</tbody> 
					</table>
				</div>
				<div class="box-footer">
					<button id="submitqq" type="submit" style="margin-left:10px;" class="btn btn-info ">提交</button>
				</div>
            </div>
		</div>
	</div>
	<script>
	var param = {};
		$("#submitqq").click(function() {
			param["type"]=$("#type2").val();
			param["realName"]=$("#realName2").val();
			param["userId"]=$("#userdd2").val(); 
			param["mobile"]=$("#mobile2").val();
			param["tel"]=$("#tel2").val();
			param["isValid"]=$("#isValid2").val();
			param["matter"]=$("#matter2").val();
			param["solve"]=$("#solve2").val();
			param["isSolve"]=$("#isSolve").val();
			ajax("#(path)/visit/edit?token=#(session.token??)",param,function(data){
				if(data.code=='success'){
					layer.msg(data.msg, {icon:1},function(){
						$("#addtels").hide();
					});
				}else if(data.code=='error'){
					layer.msg(data.msg, {icon : 2});
				}
			});
		});
		$("#type2").change(function(){
			if($("#type2").val()=="come"){
				$("#qk").hide();
			}else{
				$("#qk").show();
			}
		});
		$("#isValid2").change(function(){
			if($("#isValid2").val()=="未接"||$("#isValid2").val()=="拒接"||$("#isValid2").val()=="未响应"){
				$("#isSolve").val(0);
			}
		});
		
		$("#userId2").select2({
			ajax: {
				type:'GET',
				url: "#(path)/user/list?token=#(session.token??)",
				dataType: 'json',
				delay: 1000,
				data: function (params) {
					return {
						mobile: params.term, // search term 请求参数
						page: params.page
					};
				},
				processResults: function (data, params) {
					var itemList = [];
					var arr = data.data.page.list
					for(item in arr){
						var user = arr[item];
						
						$("#realName2").val(user.real_name);
						$("#mobile2").val(user.mobile);
						$("#userdd2").val(user.id);
						itemList.push({id:user.id, text:user.real_name});
					}
					return {
						results: itemList
					 };
				},
				cache: true
			},
			placeholder:'请输入手机号搜索...',//默认文字提示
			language: "zh-CN",
			tags: false,//允许手动添加
			allowClear: true,//允许清空
			escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
			minimumInputLength: 1,//最少输入多少个字符后开始查询
			formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
			formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
		});
	addtels2.onmousedown = function(e){
		e = window.event || e;
		var deltaX = e.clientX - addtels.offsetLeft;
		var deltaY = e.clientY - addtels.offsetTop;
		document.onmousemove= function(e){
			e = window.event || e;
			addtels.style.left = e.clientX - deltaX + "px";
			addtels.style.top = e.clientY - deltaY + "px";
		}
	};
	document.onmouseup = function(){
		this.onmousemove = null;
	};
	$("#addtel").click(function(){
	$("#addtels").show();

	$("#hidi").click(function(){
		$("#addtels").hide();
	});
});
</script>

#end 

<!--app菜单-->
#define appmenu(menu)
	<ul class="nav nav-tabs">
	  <li class="#if(menu=='appnews')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/marketing-appnews" >新闻公告</a></li>
	  <li class="#if(menu=='appcarousel')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/marketing-appcarousel" >轮播图</a></li>
	  <li class="#if(menu=='selection')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/marketing-selection" >活动精选</a></li>
	  <li class="#if(menu=='appmessage')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/marketing-appmessage">消息通知</a></li>

	</ul>
#end
<!--用户菜单--> 
#define usersmenu(menu)
	#if(shiro.hasAnyRole("admin,agent,agent_leader,agent_manager"))
	<ul class="nav nav-tabs">
		<li class="#if(menu=='list')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/user-list" >用户列表</a></li>
		<li class="#if(menu=='realname')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/user-realname" >实名列表</a></li>
		<li class="#if(menu=='openaccounts')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/user-openaccounts" >开户列表</a></li>
		<li class="#if(menu=='transaction')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/user-transaction" >充值记录</a></li>
		<li class="#if(menu=='withdraw')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/user-withdraw" >提现记录</a></li>
		<li class="#if(menu=='projectrecord')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/user-projectrecord" >投资列表</a></li>
		<li class="#if(menu=='rewards')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/user-rewards" >奖励发放</a></li>
		<li class="#if(menu=='dailyrecord')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/user-dailyrecord" >操作日志</a></li>
		<li class="#if(menu=='invites')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/user-invites" >用户邀请</a></li>
	</ul>
	#end
#end
<!--客服模块菜单-->
#define custsermenu(menu)
	<ul class="nav nav-tabs">
	  <li class="#if(menu=='trends')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/custser-trends" >客户动态</a></li>
	  <li class="#if(menu=='repayment')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/custser-repayment" >还款记录</a></li>
	</ul>
#end
<!--个人用户菜单-->

#define usermenu(menu)
<ul class="nav nav-tabs">
	<li id="jbxx" class="#if(menu=='jbxx')active#end"><a style="cursor:pointer;">基本信息</a></li>
	<li id="smxx" class="#if(menu=='smxx')active#end"><a style="cursor:pointer;">实名信息</a></li>
	<li id="khxx" class="#if(menu=='khxx')active#end"><a style="cursor:pointer;">开户信息</a></li>
	<li id="czjl" class="#if(menu=='czjl')active#end"><a style="cursor:pointer;">交易明细</a></li>
	<!--<li id="txjl" class="#if(menu=='txjl')active#end"><a>提现记录</a></li>
	<li id="tzjl" class="#if(menu=='tzjl')active#end"><a>投资记录</a></li>-->
	<li id="jlff" class="#if(menu=='jlff')active#end"><a style="cursor:pointer;">奖励发放</a></li>
	<li id="czrz" class="#if(menu=='czrz')active#end"><a style="cursor:pointer;">操作日志</a></li>
	<li id="thjl" class="#if(menu=='thjl')active#end"><a style="cursor:pointer;">通话记录</a></li>
	<li id="xgjjr" class="#if(menu=='xgjjr')active#end"><a style="cursor:pointer;">修改客服</a></li>
</ul>
<script>
	var id = GetRequest(id); 
	function GetRequest() {  
	   var url = location.search; //获取url中"?"符后的字串  
	   var theRequest = new Object();  
	   if (url.indexOf("?") != -1) {  
		  var str = url.substr(1);  
		  strs = str.split("&");  
		  for(var i = 0; i < strs.length; i ++) {  
			 theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);  
		  }  
	   }  
	   return theRequest;  
	}  
	$("#jbxx").click(function(){window.location.href="#(path)/admin/page/user-userinfo?id="+id.id});
	$("#khxx").click(function(){window.location.href="#(path)/admin/page/user-openaccount?id="+id.id});
	$("#smxx").click(function(){window.location.href="#(path)/admin/page/user-realinfo?id="+id.id});
	$("#czjl").click(function(){window.location.href="#(path)/admin/page/user-recharge?id="+id.id});
	$("#txjl").click(function(){window.location.href="#(path)/admin/page/user-withdrawals?id="+id.id});
	$("#tzjl").click(function(){window.location.href="#(path)/admin/page/user-investment?id="+id.id});
	$("#jlff").click(function(){window.location.href="#(path)/admin/page/user-rewardinfo?id="+id.id});
	$("#czrz").click(function(){window.location.href="#(path)/admin/page/user-dailyrecord2?id="+id.id});
	$("#thjl").click(function(){window.location.href="#(path)/admin/page/user-callog?id="+id.id});
	$("#xgjjr").click(function(){window.location.href="#(path)/admin/page/user-changecustom?id="+id.id});
</script>
#end 
<!--投资菜单--> 
#define targetmenu(menu)
<ul class="nav nav-tabs">
	#if(shiro.hasAnyRole("admin,assets_create"))
	<li class="#if(menu=='financing')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/target-financing" >发布标的需求</a></li>
	<li class="#if(menu=='draft')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/target-draft">草稿箱</a></li>
	#end
	#if(shiro.hasAnyRole("admin,assets_first"))
	<li class="#if(menu=='requireaudit')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/target-requireaudit" >融资需求初审</a></li>
	#end
	#if(shiro.hasAnyRole("admin,assets_second"))
	<li class="#if(menu=='requireaudit2')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/target-requireaudit2" >融资需求终审</a></li>
	#end
	#if(shiro.hasAnyRole("admin,assets_create,assets_first,assets_second"))
	<li class="#if(menu=='examine')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/target-examine" >融资审核结果</a></li>
	<li class="#if(menu=='waitlist')active#end"><a style="cursor:pointer;" href="#(path)/admin/page/target-waitlist" >自动上标列表</a></li>
	#end
</ul>
#end
<!--系统左侧菜单-->	  
#define aside(menu)
<aside style="position:fixed;top:0px;left:0px;" class="main-sidebar">
<section class="sidebar">
  <ul class="sidebar-menu">
	<li class="header"></li>
	 #if(shiro.hasAnyRole("admin,agent,agent_leader,agent_manager"))
	 <li class="treeview #if(menu=='user')active#end ">
	  <a href="#(path)/admin/page/user-list">
		<i class="fa fa-user"></i> <span>用户管理</span>
	  </a>
	</li>
	#end
	#if(shiro.hasAnyRole("admin,agent,agent_leader,agent_manager"))
	 <li class="treeview #if(menu=='custser')active#end ">
	  <a href="#">
		<i class="fa fa-phone-square"></i> <span>客服操作</span>
		<span class="pull-right-container">
		  <i class="fa fa-angle-left pull-right"></i>
		</span>
	  </a>
	  <ul style="padding-left:20px;" class="treeview-menu">
		<li><a href="#(path)/admin/page/custser-trends"><i class="fa fa-rocket "></i>客户中心</a></li>
		<li><a href="#(path)/admin/page/custser-come" ><i class="fa fa-server"></i>工单管理</a></li>
		<li><a href="#(path)/admin/page/custser-allot" ><i class="fa fa-server"></i>分配管理</a></li>
		#if(shiro.hasAnyRole("admin,agent_leader,agent_manager"))
		<li><a href="#(path)/admin/page/custser-achievement" ><i class="fa fa-thumb-tack"></i>绩效管理</a></li>
		#end
		#if(shiro.hasAnyRole("admin,agent_manager"))
		<li><a href="#(path)/admin/page/custser-repository" ><i class="fa fa-bookmark"></i>知识库</a></li>
		#end
	  </ul>
	</li> 
	#end
	#if(shiro.hasAnyRole("admin,assets_create,assets_first,assets_second"))
	<li class="treeview #if(menu=='target')active#end ">
	  <a href="#">
		<i class="fa fa-diamond"></i> <span>资产管理</span>
		<span class="pull-right-container">
		  <i class="fa fa-angle-left pull-right"></i>
		</span>
	  </a>
	  <ul style="padding-left:20px;" class="treeview-menu">
		<li><a href="#(path)/admin/page/target-financing"><i class="fa fa-tasks"></i>标的管理</a></li>
		<li><a href="#(path)/admin/page/target-findingsaudit" ><i class="fa fa-wrench"></i>融资管理</a></li>
		<li><a href="#(path)/admin/page/target-repaylist" ><i class="fa fa-object-ungroup"></i>还款管理</a></li>
	  </ul>
	</li>
	#end 
	#if(shiro.hasAnyRole("admin,product,active")) 
	<li class="treeview #if(menu=='marketing')active#end ">
	  <a href="#">
		<i class="fa  fa-cubes"></i> <span>营销管理</span>
		<span class="pull-right-container">
		  <i class="fa fa-angle-left pull-right"></i>
		</span>
	  </a> 
	  <ul style="padding-left:20px;" class="treeview-menu"> 
		#if(shiro.hasAnyRole("admin,product")) 
		<li><a href="#(path)/admin/page/marketing-redpacket"><i class="fa fa-archive"></i>优惠券管理</a></li>
		<li><a href="#(path)/admin/page/marketing-directional" ><i class="fa fa-thumb-tack"></i>奖励发放</a></li>
		#end
		#if(shiro.hasAnyRole("admin,active")) 
		<li><a href="#(path)/admin/page/marketing-appnews"><i class="fa fa-archive"></i>活动管理</a></li> 
		#end 
	  </ul>
	</li>
	#end
	#if(shiro.hasAnyRole("admin"))
	<li class="treeview #if(menu=='auxiliary')active#end ">
	  <a href="#">
		<i class="fa fa-cogs"></i> <span>辅助工具</span>
		<span class="pull-right-container">
		  <i class="fa fa-angle-left pull-right"></i>
		</span>
	  </a> 
	  <ul style="padding-left:20px;" class="treeview-menu">
		<li><a href="#(path)/admin/page/auxiliary-backlog"><i class="fa fa-calendar-check-o"></i>后台操作日志</a></li>
		<li><a href="#(path)/admin/page/auxiliary-customlist"><i class="fa fa-archive"></i>员工管理</a></li>
		<li><a href="#(path)/admin/page/auxiliary-enterprise"><i class="fa fa-bookmark"></i>企业用户</a></li>
		<li><a href="#(path)/admin/page/auxiliary-basicset"><i class="fa  fa-gear"></i>基础参数设置</a></li>
		<li><a href="#(path)/admin/page/marketing-appcontrol"><i class="fa  fa-gear"></i>协议说明</a></li>
		<li><a href="#(path)/admin/page/marketing-applist"><i class="fa  fa-gear"></i>版本更新</a></li>
	  </ul>
	</li>
	#end
	<li class="treeview #if(menu=='auxiliary')#end ">
	  <a  href="#" id="jfsc">
		<i class="fa fa-shopping-cart"></i> <span>积分商城</span>
		
	  </a> 
	  <ul class="treeview-menu">
		<!--<li><a href="#(path)/admin/page/auxiliary-backlog"><i class="fa fa-calendar-check-o"></i>后台操作日志</a></li>
		<li><a href="#(path)/admin/page/auxiliary-customlist"><i class="fa fa-archive"></i>员工管理</a></li>
		<li><a href="#(path)/admin/page/auxiliary-enterprise"><i class="fa fa-bookmark"></i>企业用户</a></li>
		<li><a href="#(path)/admin/page/auxiliary-basicset"><i class="fa  fa-gear"></i>基础参数设置</a></li>-->
	  </ul>
	  <script>
		$("#jfsc").click(function(){
			layer.msg("付费开发", {icon:2,time:1000},function(){
				
			});
		}); 
	  </script>
	</li>
	<li class="treeview #if(menu=='auxiliary')#end ">
	  <a  href="#" id="sqgl">
		<i class="fa fa-comments-o"></i> <span>社区管理</span>
	  </a> 
	  <ul class="treeview-menu">
		<!--<li><a href="#(path)/admin/page/auxiliary-backlog"><i class="fa fa-calendar-check-o"></i>后台操作日志</a></li>
		<li><a href="#(path)/admin/page/auxiliary-customlist"><i class="fa fa-archive"></i>员工管理</a></li>
		<li><a href="#(path)/admin/page/auxiliary-enterprise"><i class="fa fa-bookmark"></i>企业用户</a></li>
		<li><a href="#(path)/admin/page/auxiliary-basicset"><i class="fa  fa-gear"></i>基础参数设置</a></li>-->
	  </ul>
	  <script>
		$("#sqgl").click(function(){
			layer.msg("付费开发", {icon:2,time:1000},function(){
				
			});
		});
	  </script>
	</li>
	<li class="treeview #if(menu=='auxiliary')#end ">
	  <a  href="#" id="sjfx">
		<i class="fa fa-line-chart"></i> <span>数据分析</span>
		
	  </a> 
	  <ul class="treeview-menu">
		<!--<li><a href="#(path)/admin/page/auxiliary-backlog"><i class="fa fa-calendar-check-o"></i>后台操作日志</a></li>
		<li><a href="#(path)/admin/page/auxiliary-customlist"><i class="fa fa-archive"></i>员工管理</a></li>
		<li><a href="#(path)/admin/page/auxiliary-enterprise"><i class="fa fa-bookmark"></i>企业用户</a></li>
		<li><a href="#(path)/admin/page/auxiliary-basicset"><i class="fa  fa-gear"></i>基础参数设置</a></li>-->
	  </ul>
	  <script>
		$("#sjfx").click(function(){
			layer.msg("付费开发", {icon:2,time:1000},function(){
				
			});
		});
	  </script>
	</li>
	#if(shiro.hasAnyRole("admin,plat"))
	<li class="treeview #if(menu=='financial')active#end "> 
	  <a  href="#">
		<i class="fa fa-rmb"></i> <span>财务管理</span>
		
	  </a> 
	  <ul style="padding-left:20px;" class="treeview-menu">
		<li><a href="#(path)/admin/page/financial-transfer "><i class="fa fa-calendar-check-o"></i>转账</a></li>
	  </ul>
	</li>
	#end
	<li class="treeview">
	  <a onclick="logout()">
		<i class="fa fa-sign-out"></i> <span>退出系统</span>
	  </a>
	</li> 
	<script>
		function logout(){
			$.getJSON("#(path)/user/logout?token=#(session.token??)&type=backend", function(data){
				if(data.code=='success'){
					layer.msg(data.msg, {icon:1,time:1000},function(){
						location.href="#(path)/admin/page/user-login"
					});
				}else if(data.code=='error'){
					layer.msg(data.msg, {icon:2,time:1000});
				}
			});
		}
	</script>
	 
  </ul>
</section> 
</aside>
#end  
<!--版权信息-->
#define footer()
<footer class="main-footer">
<div class="pull-right hidden-xs">
  <b>版本号</b> 1.0.1
</div>
<strong>Copyright © 2017 <a href="http://almsaeedstudio.com">大秦科技版权所有</a>.</strong> 
</footer>

#end
#define checkToken()
<script type="text/javascript" src="#(assets)/js/app.js"></script>
<script>
	console.log("#(session.token??)"); 
	if("#(session.token??)"==""){
		layer.msg("登陆超时，请重新登陆！", {icon:1,time:1000},function(){ 
			location.href="#(path)/app/page/user-login";
		});
	}else{
		ajax("#(path)/user/checkToken?token=#(session.token??)",{},function(data){
			if(data.code=='error'){
				layer.msg("登陆超时，请重新登陆！", {icon:1,time:1000},function(){
					location.href="#(path)/app/page/user-login";
				});
			}
		});
	}
</script>
#end
#define checkToken2()
<script type="text/javascript" src="#(assets)/js/app.js"></script>
<script>
	console.log("#(session.token??)"); 
	if("#(session.token??)"==""){
		layer.msg("登陆超时，请重新登陆！", {icon:1,time:2000},function(){
			location.href="#(path)/user-login"; 
		});
	}else{
		ajax("#(path)/user/checkToken?token=#(session.token??)",{},function(data){
			console.log("token=#(session.token??)");
			if(data.code=='error'){
				layer.msg("登陆超时，请重新登陆！", {icon:1,time:2000},function(){
					location.href="#(path)/user-login";
				});
			}
		});
	}
</script>
#end